package hr.mapper;

import hr.entity.DO.EmployeeMovementDO;
import hr.entity.EmployeeMovement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 员工调动记录表 Mapper 接口
 * </p>
 *
 * @author zzh
 * @since 2023-12-14
 */
@Mapper
public interface EmployeemovementMapper extends BaseMapper<EmployeeMovement> {

    List<EmployeeMovementDO> getEmployeeMovement(@Param("name") String name,
                                                 @Param("md") long movementDate,
                                                 @Param("dateEnd") long dateEnd,
                                                 @Param("offset") long offset,
                                                 @Param("limit") Long limit);

    Integer getCount(@Param("name") String name, @Param("md") String movementDate);

    Integer updateDepartmentPostMovement(@Param("movementId") Integer movementId,
                                         @Param("toDepartmentName") String toDepartmentName,
                                         @Param("toPositionName") String toPositionName);

    Integer updateDepartment(@Param("movementId")Long movementId,  @Param("toDepartmentName") String toDepartmentName);

    Integer updatePosition(@Param("movementId")Long movementId,  @Param("toPositionName")String toPositionName);

    List<EmployeeMovementDO> selectEmployeeMovementByEmpId(@Param("employeeId") Long employeeId);
}
